Working with Cross-Tabs

Modifying a cross-tab at runtime

A CrossTabObject object in the Report Designer represents a single cross-tab in your report. Cross-tabs are specialized subreports. Even if you design your primary report as a cross-tab, it is added to the report page as a separate object inside the report.

CrossTabObject objects can be obtained from a report much like subreports. A CrossTabObject is implemented as a single report object accessible through the ReportObjects collection.

The following code searches for cross-tabs in a report and applies formatting features to make them stand out from the rest of the report.

Dim CRXReport As New CrystalReport1
Dim CRXXtObject As CRAXDRT.CrossTabObject
Dim CRXSection As Section
Dim CRXReportObject As Object For Each CRXSection In Report.Sections     For Each CRXReportObject In sect.ReportObjects         If CRXReportObject.Kind = crCrosstabObject Then             Set CRXXtObject = CRXReportObject
            CRXXtObject.BorderColor = RGB(255, 0, 0)
            CRXXtObject.HasDropShadow = True
            Set CRXXtObject = Nothing                 End If             Next Next

Although cross-tabs are much like subreports, because of their specialized handling of data, there are fewer properties available to the CrossTabObject object than to the SubreportObject object. Before trying to use a property with a cross-tab in your report, verify that the property is available to the CrossTabObject object.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com